package by.dvrudenko.avtobaza.datamodel;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Entity
public class Driver implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@ManyToOne(fetch = FetchType.EAGER, targetEntity = User.class)
	private User user;

	@Column
	@NotNull
	@Size(max = 100)
	private String lastName;

	@Column
	private Timestamp birthday;

	@Column
	private Timestamp experience;

	@Column
	@NotNull
	private Boolean work;

	@Column
	private String foto;

	@Column
	@NotNull
	private Integer acomplishRoutes;

	public Integer getAcomplishRoutes() {
		return acomplishRoutes;
	}

	public void setAcomplishRoutes(Integer acomplishRoutes) {
		this.acomplishRoutes = acomplishRoutes;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public Timestamp getAge() {
		return birthday;
	}

	public void setAge(Timestamp age) {
		this.birthday = age;
	}

	public Timestamp getExperience() {
		return experience;
	}

	public void setExperience(Timestamp experience) {
		this.experience = experience;
	}

	public Boolean getWork() {
		return work;
	}

	public void setWork(Boolean work) {
		this.work = work;
	}

	public String getFoto() {
		return foto;
	}

	public void setFoto(String foto) {
		this.foto = foto;
	}

}
